package com.ruis.kotboot.controller

import com.ruis.kotboot.api.service.RuisCacheService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody
import javax.servlet.http.HttpServletRequest


@Controller
class ExampleController{

    @Autowired
    private val service:RuisCacheService?=null
//    @Autowired
//    private val testFeign:TestFeign?=null
//    @Autowired
//    var discoveryClient: DiscoveryClient? = null
//    @Autowired
//    private val loadBalancer: LoadBalancerClient? = null
//
//    @RequestMapping("/test1")
//    @ResponseBody
//    fun test1(req:HttpServletRequest):Any?{
//        return discoveryClient?.getInstances("KotBoot-ydt")?.get(0)
//    }
//    @RequestMapping("/test2")
//    @ResponseBody
//    fun test2(req:HttpServletRequest):Any?{
//        return loadBalancer?.choose("KotBoot-ydt")
//    }
//    @RequestMapping("/test3")
//    @ResponseBody
//    fun test3(req:HttpServletRequest):Any?{
//        return testFeign?.test("ruis")
//    }

    @RequestMapping("/")
    @ResponseBody
    fun hello(req:HttpServletRequest):Any?{
        return "hello world"
    }
}